
#ifndef COMMON_HPP
#define COMMON_HPP

// Auxiliary classes, functions and macros //


// Find out if an IWidget object is a certain QtWi abstract type
#define qtwi_rtti_cmp(OBJ, QTWI_TYPE) \
		(typeid(OBJ) == typeid(Q##QTWI_TYPE) || typeid(OBJ) == typeid(T##QTWI_TYPE))

#ifdef DEBUG
# include <iostream>
#endif

#include <typeinfo>

// Create derived IException class
#define class_iexception(EXCNAME, INFO) \
	class EXCNAME : public IException {\
	public:\
		EXCNAME() : IException(__FILE__, __LINE__, INFO, typeid(EXCNAME).name()) { }\
	};

#include <sstream>

template <class T>
inline std::string _qtwi_to_string(const T& t)
{
	std::stringstream ss;
	ss << t;
	return ss.str();
}

#endif
